<?php

namespace App\Services\Fund;

use App\Services\ProjectValidate;

/**
 *
 * Class ValidateWithdraw
 * @package App\Services\Fund
 */
class ValidateWithdraw extends ProjectValidate
{

    /**
     * 自定义子类初始化
     * @param array $initData
     * @return mixed
     */
    public function initValidate($initData = [])
    {
        // TODO: Implement initValidate() method.
         if(!empty($initData['action'])) {
            $initData['action'] == 'adminWithdrawList' && $this->rules = ['status' =>  'in:0,1,2,3,4'];

        }
        if(!empty($initData['action'])) {
            $initData['action'] == 'auditWithdraw' && $this->rules = ['status' =>  'in:1,2','name' => 'required|min:2'];

        }
        if(!empty($initData['action'])) {
            $initData['action'] == 'auditTransfer' && $this->rules = ['status' =>  'in:3,4'];

        }
    }


    /**
     * @var array 用户模块的验证集合
     */
    public $rules = [
        'id'   => 'integer|min:1',
        'user_id'        => 'integer|min:1',
        'review_id'        => 'integer|min:1',
        'transfer_id'        => 'integer|min:1',
        'card_id'        => 'integer|min:1',
        'type'        => 'in:alipay,bank',
        'money'        => 'integer|min:1',
        'account'     => 'min:2',
        'name'     => 'min:2',
        'number'     => 'min:15|max:19',
        'status'     => 'in:1',
    ];



    public $messages = [
       
    ];

    /**
     * @var array 上面规则中定义的 key 的名字
     */
    public $attributes = [
      
    ];

   
}